use api_open_plat_db;

DROP TABLE IF EXISTS `interface_info`;
CREATE TABLE `interface_info` (
                                  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
                                  `name` varchar(256) NOT NULL COMMENT '名称',
                                  `description` varchar(256) DEFAULT NULL COMMENT '描述',
                                  `url` varchar(512) NOT NULL COMMENT '接口地址',
                                  `requestParams` text COMMENT '请求参数',
                                  `requestHeader` text COMMENT '请求头',
                                  `responseHeader` text COMMENT '响应头',
                                  `status` int NOT NULL DEFAULT '0' COMMENT '接口状态（0-关闭，1-开启）',
                                  `method` varchar(256) NOT NULL COMMENT '请求类型',
                                  `userId` bigint NOT NULL COMMENT '创建人',
                                  `createTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
                                  `updateTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
                                  `isDelete` tinyint NOT NULL DEFAULT '0' COMMENT '是否删除(0-未删, 1-已删)',
                                  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='接口信息';

-- ----------------------------
-- Records of interface_info
-- ----------------------------
BEGIN;
INSERT INTO `interface_info` (`id`, `name`, `description`, `url`, `requestParams`, `requestHeader`, `responseHeader`, `status`, `method`, `userId`, `createTime`, `updateTime`, `isDelete`) VALUES (1, '许擎宇', '薛聪健', 'www.cary-king.net', NULL, '潘博涛', '谭聪健', 0, '石炫明', 9500534531, '2023-03-20 21:50:25', '2023-03-22 15:31:15', 1);
INSERT INTO `interface_info` (`id`, `name`, `description`, `url`, `requestParams`, `requestHeader`, `responseHeader`, `status`, `method`, `userId`, `createTime`, `updateTime`, `isDelete`) VALUES (2, '陆弘文', '白志强', 'www.leslee-kuhn.net', NULL, '潘懿轩', '马鸿涛', 0, '陈峻熙', 3982575846, '2023-03-20 21:50:26', '2023-03-23 14:52:43', 1);
INSERT INTO `interface_info` (`id`, `name`, `description`, `url`, `requestParams`, `requestHeader`, `responseHeader`, `status`, `method`, `userId`, `createTime`, `updateTime`, `isDelete`) VALUES (3, '毛建辉', '罗文', 'www.rosaria-kilback.io', NULL, '冯子默', '彭哲瀚', 0, '赵远航', 121776355, '2023-03-20 21:50:27', '2023-03-23 14:55:19', 1);
INSERT INTO `interface_info` (`id`, `name`, `description`, `url`, `requestParams`, `requestHeader`, `responseHeader`, `status`, `method`, `userId`, `createTime`, `updateTime`, `isDelete`) VALUES (4, '彭雨泽', '蔡煜祺', 'www.norris-bergstrom.biz', NULL, '董思源', '田晓博', 0, '潘擎宇', 740, '2023-03-20 21:50:27', '2023-03-23 15:05:00', 1);
INSERT INTO `interface_info` (`id`, `name`, `description`, `url`, `requestParams`, `requestHeader`, `responseHeader`, `status`, `method`, `userId`, `createTime`, `updateTime`, `isDelete`) VALUES (5, '傅志强', '陈梓晨', 'www.jordan-reinger.com', '111', '金志强', '熊锦程', 0, '邓睿渊', 35542559, '2023-03-20 21:50:28', '2023-03-24 10:01:24', 0);
INSERT INTO `interface_info` (`id`, `name`, `description`, `url`, `requestParams`, `requestHeader`, `responseHeader`, `status`, `method`, `userId`, `createTime`, `updateTime`, `isDelete`) VALUES (6, '吕黎昕', '孔越彬', 'www.fe-okon.info', NULL, '万伟宸', '林昊然', 1, '孟荣轩', 1445, '2023-03-20 21:50:28', '2023-03-23 15:07:11', 0);
INSERT INTO `interface_info` (`id`, `name`, `description`, `url`, `requestParams`, `requestHeader`, `responseHeader`, `status`, `method`, `userId`, `createTime`, `updateTime`, `isDelete`) VALUES (7, '夏雪松', '许子骞', 'www.lashawna-legros.co', NULL, '蔡昊然', '胡鹏涛', 1, '钟立辉', 34075514, '2023-03-20 21:50:29', '2023-03-23 15:07:15', 0);
INSERT INTO `interface_info` (`id`, `name`, `description`, `url`, `requestParams`, `requestHeader`, `responseHeader`, `status`, `method`, `userId`, `createTime`, `updateTime`, `isDelete`) VALUES (8, '严钰轩', '阎志泽', 'www.kay-funk.biz', NULL, '莫皓轩', '郭黎昕', 1, '龚天宇', 70956, '2023-03-20 21:50:29', '2023-03-23 15:07:16', 0);
INSERT INTO `interface_info` (`id`, `name`, `description`, `url`, `requestParams`, `requestHeader`, `responseHeader`, `status`, `method`, `userId`, `createTime`, `updateTime`, `isDelete`) VALUES (9, '萧嘉懿', '曹熠彤', 'www.margarette-lindgren.biz', NULL, '田泽洋', '邓睿渊', 1, '梁志强', 98, '2023-03-20 21:50:30', '2023-03-24 09:56:15', 0);
INSERT INTO `interface_info` (`id`, `name`, `description`, `url`, `requestParams`, `requestHeader`, `responseHeader`, `status`, `method`, `userId`, `createTime`, `updateTime`, `isDelete`) VALUES (10, '杜驰', '冯思源', 'www.vashti-auer.org', NULL, '黎健柏', '武博文', 1, '李伟宸', 9, '2023-03-20 21:50:30', '2023-03-24 09:56:28', 0);
INSERT INTO `interface_info` (`id`, `name`, `description`, `url`, `requestParams`, `requestHeader`, `responseHeader`, `status`, `method`, `userId`, `createTime`, `updateTime`, `isDelete`) VALUES (11, '史金鑫', '蔡鹏涛', 'www.diann-keebler.org', NULL, '徐烨霖', '阎建辉', 0, '李烨伟', 125, '2023-03-20 21:50:31', '2023-03-20 21:50:31', 0);
INSERT INTO `interface_info` (`id`, `name`, `description`, `url`, `requestParams`, `requestHeader`, `responseHeader`, `status`, `method`, `userId`, `createTime`, `updateTime`, `isDelete`) VALUES (12, '林炫明', '贾旭尧', 'www.dotty-kuvalis.io', NULL, '梁雨泽', '龙伟泽', 0, '许智渊', 79998, '2023-03-20 21:50:31', '2023-03-20 21:50:31', 0);
INSERT INTO `interface_info` (`id`, `name`, `description`, `url`, `requestParams`, `requestHeader`, `responseHeader`, `status`, `method`, `userId`, `createTime`, `updateTime`, `isDelete`) VALUES (13, '何钰轩', '赖智宸', 'www.andy-adams.net', NULL, '崔思淼', '白鸿煊', 0, '邵振家', 7167482751, '2023-03-20 21:50:32', '2023-03-20 21:50:32', 0);
INSERT INTO `interface_info` (`id`, `name`, `description`, `url`, `requestParams`, `requestHeader`, `responseHeader`, `status`, `method`, `userId`, `createTime`, `updateTime`, `isDelete`) VALUES (14, '魏志强', '于立诚', 'www.ione-aufderhar.biz', NULL, '朱懿轩', '万智渊', 0, '唐昊强', 741098, '2023-03-20 21:50:32', '2023-03-20 21:50:32', 0);
INSERT INTO `interface_info` (`id`, `name`, `description`, `url`, `requestParams`, `requestHeader`, `responseHeader`, `status`, `method`, `userId`, `createTime`, `updateTime`, `isDelete`) VALUES (15, '严君浩', '金胤祥', 'www.duane-boyle.org', NULL, '雷昊焱', '侯思聪', 0, '郝思', 580514, '2023-03-20 21:50:33', '2023-03-20 21:50:33', 0);
INSERT INTO `interface_info` (`id`, `name`, `description`, `url`, `requestParams`, `requestHeader`, `responseHeader`, `status`, `method`, `userId`, `createTime`, `updateTime`, `isDelete`) VALUES (16, '姚皓轩', '金鹏', 'www.lyda-klein.biz', NULL, '杜昊强', '邵志泽', 0, '冯鸿涛', 6546, '2023-03-20 21:50:33', '2023-03-20 21:50:33', 0);
INSERT INTO `interface_info` (`id`, `name`, `description`, `url`, `requestParams`, `requestHeader`, `responseHeader`, `status`, `method`, `userId`, `createTime`, `updateTime`, `isDelete`) VALUES (17, '廖驰', '沈泽洋', 'www.consuelo-sipes.info', NULL, '彭昊然', '邓耀杰', 0, '周彬', 7761037, '2023-03-20 21:50:34', '2023-03-20 21:50:34', 0);
INSERT INTO `interface_info` (`id`, `name`, `description`, `url`, `requestParams`, `requestHeader`, `responseHeader`, `status`, `method`, `userId`, `createTime`, `updateTime`, `isDelete`) VALUES (18, '赖智渊', '邓志泽', 'www.emerson-mann.co', NULL, '熊明哲', '贺哲瀚', 0, '田鹏', 381422, '2023-03-20 21:50:34', '2023-03-20 21:50:34', 0);
INSERT INTO `interface_info` (`id`, `name`, `description`, `url`, `requestParams`, `requestHeader`, `responseHeader`, `status`, `method`, `userId`, `createTime`, `updateTime`, `isDelete`) VALUES (19, '许涛', '陆致远', 'www.vella-ankunding.name', NULL, '贾哲瀚', '莫昊焱', 0, '袁越彬', 4218096, '2023-03-20 21:50:35', '2023-03-20 21:50:35', 0);
INSERT INTO `interface_info` (`id`, `name`, `description`, `url`, `requestParams`, `requestHeader`, `responseHeader`, `status`, `method`, `userId`, `createTime`, `updateTime`, `isDelete`) VALUES (20, '吕峻熙', '沈鹏飞', 'www.shari-reichel.org', NULL, '郭鸿煊', '覃烨霖', 0, '熊黎昕', 493, '2023-03-20 21:50:35', '2023-03-20 21:50:35', 0);
INSERT INTO `interface_info` (`id`, `name`, `description`, `url`, `requestParams`, `requestHeader`, `responseHeader`, `status`, `method`, `userId`, `createTime`, `updateTime`, `isDelete`) VALUES (21, 'test', 'test', '1', '1', '1', '1', 0, 'get', 1637809476402491394, '2023-03-21 11:05:39', '2023-03-22 15:28:26', 1);
INSERT INTO `interface_info` (`id`, `name`, `description`, `url`, `requestParams`, `requestHeader`, `responseHeader`, `status`, `method`, `userId`, `createTime`, `updateTime`, `isDelete`) VALUES (22, 'getNameByPostReslt', '根据名字获取参数', 'http://localhost:8123/api/name/getNameByPostRest', '{\"name\": string}', '{application/json}', '{application/json}', 0, 'POST', 1638085356379185153, '2023-03-23 21:23:53', '2023-03-23 21:24:01', 1);
INSERT INTO `interface_info` (`id`, `name`, `description`, `url`, `requestParams`, `requestHeader`, `responseHeader`, `status`, `method`, `userId`, `createTime`, `updateTime`, `isDelete`) VALUES (23, 'getNameByPostReslt', '根据名字获取参数', 'http://localhost:8123/api/name/getNameByPostRest', '{\"name\": string}', '{application/json}', '{application/json}', 1, 'POST', 1638085356379185153, '2023-03-23 21:24:06', '2023-03-24 10:01:19', 0);
COMMIT;
-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
                        `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
                        `userAccount` varchar(256) COLLATE utf8_bin NOT NULL COMMENT '账号',
                        `userPassword` varchar(512) COLLATE utf8_bin NOT NULL COMMENT '密码',
                        `gender` tinyint DEFAULT NULL COMMENT '性别',
                        `accessKey` varchar(256) COLLATE utf8_bin DEFAULT NULL COMMENT '签名 accessKey',
                        `userName` varchar(256) COLLATE utf8_bin DEFAULT NULL COMMENT '用户昵称',
                        `userAvatar` varchar(1024) COLLATE utf8_bin DEFAULT NULL COMMENT '用户头像',
                        `secretKey` varchar(512) COLLATE utf8_bin DEFAULT NULL COMMENT '签名 secretKey',
                        `userRole` varchar(256) COLLATE utf8_bin NOT NULL DEFAULT 'user' COMMENT '用户角色：user/admin/ban',
                        `createTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
                        `updateTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
                        `isDelete` tinyint NOT NULL DEFAULT '0' COMMENT '是否删除',
                        PRIMARY KEY (`id`),
                        KEY `idx_unionId` (`gender`)
) ENGINE=InnoDB AUTO_INCREMENT=1638085356379185155 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='用户';

-- ----------------------------
-- Records of user
-- ----------------------------
BEGIN;
INSERT INTO `user` (`id`, `userAccount`, `userPassword`, `gender`, `accessKey`, `userName`, `userAvatar`, `secretKey`, `userRole`, `createTime`, `updateTime`, `isDelete`) VALUES (1637809476402491394, 'hytz', 'b0dd3697a192885d7c055db46155b26a', NULL, NULL, NULL, NULL, NULL, 'user', '2023-03-20 21:33:03', '2023-03-20 21:33:03', 0);
INSERT INTO `user` (`id`, `userAccount`, `userPassword`, `gender`, `accessKey`, `userName`, `userAvatar`, `secretKey`, `userRole`, `createTime`, `updateTime`, `isDelete`) VALUES (1638085356379185153, 'test', 'b0dd3697a192885d7c055db46155b26a', NULL, NULL, NULL, NULL, NULL, 'admin', '2023-03-21 15:49:17', '2023-03-21 15:49:32', 0);
INSERT INTO `user` (`id`, `userAccount`, `userPassword`, `gender`, `accessKey`, `userName`, `userAvatar`, `secretKey`, `userRole`, `createTime`, `updateTime`, `isDelete`) VALUES (1638085356379185154, 'HYTZ123', 'b0dd3697a192885d7c055db46155b26a', NULL, 'd4a66b9b178038f3febae878e9d0d106', NULL, NULL, 'e91e7750acfca0005af38a7f5f1cc42a', 'user', '2023-03-23 20:59:24', '2023-03-23 20:59:24', 0);
COMMIT;

-- ----------------------------
-- Table structure for user_interface_info
-- ----------------------------
DROP TABLE IF EXISTS `user_interface_info`;
CREATE TABLE `user_interface_info` (
                                       `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
                                       `userId` bigint NOT NULL COMMENT '调用用户 id',
                                       `interfaceInfoId` bigint NOT NULL COMMENT '接口 id',
                                       `totalNum` int NOT NULL DEFAULT '0' COMMENT '总调用次数',
                                       `leftNum` int NOT NULL DEFAULT '0' COMMENT '剩余调用次数',
                                       `status` int NOT NULL DEFAULT '0' COMMENT '0-正常，1-禁用',
                                       `createTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
                                       `updateTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
                                       `isDelete` tinyint NOT NULL DEFAULT '0' COMMENT '是否删除(0-未删, 1-已删)',
                                       PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='用户调用接口关系';

-- ----------------------------
-- Records of user_interface_info
-- ----------------------------
BEGIN;
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;

